using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace CubicFWNet.Data.Models.Mapping
{
    public class InventoryMap : EntityTypeConfiguration<Inventory>
    {
        public InventoryMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            //this.Property(t => t.ProuctName)
            //    .HasMaxLength(64);

            //this.Property(t => t.Unit)
            //    .HasMaxLength(64);

            //this.Property(t => t.Format)
            //    .HasMaxLength(64);

            this.Property(t => t.Memo)
                .HasMaxLength(256);

            // Table & Column Mappings
            this.ToTable("Inventory");
            this.Property(t => t.Id).HasColumnName("Id");
            //this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.StorageId).HasColumnName("StorageId");
            this.Property(t => t.ProuctId).HasColumnName("ProuctId");
            //this.Property(t => t.ProuctName).HasColumnName("ProuctName");
            this.Property(t => t.Amount).HasColumnName("Amount");
            this.Property(t => t.Amount_Init).HasColumnName("Amount_Init");
            //this.Property(t => t.Format).HasColumnName("Format");
            this.Property(t => t.Memo).HasColumnName("Memo");
            //this.Property(t => t.Area).HasColumnName("Area");
        }
    }
}
